<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'login.jsp' starting page</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style>
	form{
		background-image: url(img/jixue.jpg);
	}
</style>
  </head>
  
  <body>
    <h1>用户登录</h1>
    <p style="color:red;">
    ${msg}
    </p>
   <%--  <%
    	String m=(String)request.getAttribute("msg");
     %>
     <p style="color:red">
     <%=m==null?"":m %>
     </p> --%>
     <%
     	String name="";
     	Cookie []cr=request.getCookies();
     	for(int i=0;cr!=null&&i<cr.length;i++){
     		if(cr[i].getName().equals("user_name")){
     			name=cr[i].getValue();
     			break;
     		}
     	}
      %>
    <form action="loginServlet" method="get">
    	<p>
    	<input type="text" name="uname" value="<%=name%>" placeholder="用户名" /> 
		<input type="password" name="pass" placeholder="密码" /> 
    	</p>
    	<input type="submit" value="登录"/>
    </form>
  </body>
</html>
